package com.api.test.app;

import com.api.test.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class SendResult extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.send_result);
		
		Button button = (Button) findViewById(R.id.corky);
		button.setOnClickListener(mCorkyListener);
		button = (Button) findViewById(R.id.violet);
		button.setOnClickListener(mVioletListener);
	}
	
	private OnClickListener mCorkyListener = new OnClickListener() {
		
		@Override
		public void onClick(View v) {
			setResult(RESULT_OK, (new Intent()).setAction("Corky!"));
			finish();
		}
	};
	
	private OnClickListener mVioletListener = new OnClickListener() {
		
		@Override
		public void onClick(View v) {
			setResult(RESULT_OK, (new Intent()).setAction("Violet!"));
			finish();
		}
	};
}
